package com.mf.springboot.backend.userAuth.controller.menu;

import com.mf.springboot.backend.commonModule.bean.JSONResult;
import com.mf.springboot.backend.mybatisModule.bean.TSysMenuDTO;
import com.mf.springboot.backend.userAuth.service.menu.MenuService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by java_jony on 2017/9/25.
 */
@Controller
@RequestMapping("menus")
public class MenuController {

    @Resource
    private MenuService menuService;

    @RequestMapping("/getMenus")
    @ResponseBody
    public  JSONResult getMenus(String arg) {
        try {
            JSONResult jsonResult = new JSONResult();
            List<TSysMenuDTO> sysMenuDTOS = menuService.getMenus("2");
            jsonResult.getBody().put("route",sysMenuDTOS);
            jsonResult.getBody().put("isCollapse",false);
            return jsonResult;
        } catch (Exception e) {
            e.printStackTrace();
//            return JSONResult.getFail("系统异常！");
        }
        return null;
    }
}
